/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2022. All rights reserved.
 * Description: 集合通信算子信息库头文件
 * Author: lilianlin
 * Create: 2019-11-28
 */

#ifndef HVD_OPS_KERNEL_BUILDER_H
#define HVD_OPS_KERNEL_BUILDER_H

#include "ops_kernel_builder_base.h"
#include "op_hvd_comm.h"

namespace hccl {
// Ge适配的类
class HvdOpsKernelBuilder : public HCCLOpsKernelBuilder {
public:
    HvdOpsKernelBuilder();
    ~HvdOpsKernelBuilder() override;
    // memory allocation requirement
    ge::Status CalcOpRunningParam(ge::Node& node) override;
    // generate taskinfo for op
    ge::Status GenerateTask(const ge::Node &node, ge::RunContext &runContext, \
        std::vector<domi::TaskDef> &taskDefList) override;
private:
    HcclResult GetSupportedOP(std::vector<std::string> &hcclSupportOp) const override;
    HcclResult SetOpMemAttr(ge::Node& node, const std::string &sCollectiveType, const u64 &opMemSize) override;
    HcclResult SetOpAtomicInputIndex(ge::Node& node, const std::string &sCollectiveType) override;
    HcclResult GetEventIDFromOpDesc(const ge::OpDescPtr &op, u32 &eventID);
};
}
#endif // GE_OPS_KERNEL_INFO_H
